from peewee import *

database = MySQLDatabase('crane_machine',
                         **{'port': 3306, 'user': 'root', 'password': 'Aa123456', 'host': '43.254.44.139'})


class UnknownField(object):
    def __init__(self, *_, **__): pass


class BaseModel(Model):
    class Meta:
        database = database


class MachineInfo(BaseModel):
    create_time = DateTimeField(null=True)
    create_user = CharField(null=True)
    dev_img = CharField(null=True)
    dev_name = CharField()
    dev_number = CharField()
    is_deleted = IntegerField(null=True)
    update_time = DateTimeField(null=True)
    update_user = CharField(null=True)

    class Meta:
        db_table = 'machine_info'
